﻿<!--{template header}-->
<script language="javascript" src="image/editor/editor_function.js"></script>
<script type="text/javascript">
function validate() {
	var subject = $('title');
	if (subject) {
		var slen = strlen(subject.value);
		if (slen < 1 || slen > 80) {
			alert("标题长度(1~80字符)不符合要求");
			subject.focus();
			return false;
		}
	}
	return true;
}
function checkForm() {

	edit_save();
	if($('score').value=='' ||  isNaN($('score').value)  || parseInt($('score').value) < 1 || parseInt($('score').value) > {$gMaxScore} ) {
		alert("积分值请填写1-{$gMaxScore}之间");
		$('score').focus();
		return false;
	}
	if( !validate() ) {
		return false;
	}
	if($('uchome-ttHtmlEditor').value == '<DIV></DIV>')
	{
		alert('请填写内容');
		return false;
	}
	
	return true;
}
</script>

<div class="h_status">
<table width="100%">
<tr><td>
<h1><!--{if $id}-->编辑提问<!--{else}-->发布提问<!--{/if}-->  <a href="ask.php?do=ask">返回问答列表</a></h1>
</td></tr></table>
</div>
<STYLE>
.userData {behavior:url(#default#userdata);}
</STYLE>
<div class="d_content">
	<form method="post" action="ask.php?do=ask&ac=cp&op=post" enctype="multipart/form-data" onsubmit="return checkForm()">
	<input type="hidden" name="ask_id" id="ask_id" value="$info[id]"  />
		<table cellspacing="4" cellpadding="4" width="100%" class="infotable">
			<tr>
				<td>
					问题：
					<input type="text" class="t_input" id="title" name="title" value="$info[title]" size="80" />
				</td>
			</tr>
			<tr>
			  <td>
					类别： <select name="typeid" id="typeid">
<!--{loop $gEumsType $typeid $typename}-->
<option value="$typeid" <!--{if $typeid == $info[typeid] }-->selected="selected"<!--{/if}--> >$typename</option>				
<!--{/loop}-->	
					</select>
				  &nbsp;&nbsp;
				  悬赏积分值：<input name="score" id="score" title="此积分值将直接从您的积分中扣除" size="8" value="$info[score]" <!--{if $info[score]>0 }-->disabled="disabled" title="悬赏积分值不能修改"<!--{/if}--> />(1-{$gMaxScore}个)
					(先扣除;有满意答案时结贴，您将积分值分给回答问题的人) 目前您的积分<font color="#FF0000">$space[credit]</font>				</td>
			</tr>
			<tr>
				<td>
				<textarea class="userData" name="content" id="uchome-ttHtmlEditor" style="height:100%;width:100%;display:none;border:0px">$info[content]</textarea>
				<iframe src="editor.php?charset=$_SC[charset]&allowhtml=$allowhtml" name="uchome-ifrHtmlEditor" id="uchome-ifrHtmlEditor" scrolling="no" border="0" frameborder="0" style="width:100%;border: 1px solid #C5C5C5;" height="400"></iframe>
				</td>
			</tr>

		</table>
	<table cellspacing="4" cellpadding="4" width="100%" class="infotable">
		<tr>
			<th width="60">　</th>
			<td><input type="submit" id="issuance" value="保存发布" class="submit"  />
			<a href="ask.php?do=ask">返回列表</a>
			</td>
		</tr>
	</table>	
	</form>
</div>
<!--{template footer}-->